Back to course home
0% completed
Vote For New Content
Google Hard
Shortest Subarray with Sum at Least K (hard)
Solution: Shortest Subarray with Sum at Least K
Reverse Pairs (hard)
Solution: Reverse Pairs
Nth Magical Number (hard)
Solution: Nth Magical Number
Candy (hard)
Solution: Candy
Arithmetic Slices II - Subsequence (hard)
Solution: Arithmetic Slices II - Subsequence
Burst Balloons (hard)
Solution: Burst Balloons
Sum of Distances in Tree (hard)
Solution: Sum of Distances in Tree
Maximum Score of a Good Subarray (hard)
Solution: Maximum Score of a Good Subarray
Trapping Rain Water (hard)
Solution: Trapping Rain Water
First Missing Positive (hard)
Solution: First Missing Positive
Strobogrammatic Number II (medium)
Problem Statement
Given a positive integer n, return all the strobogrammatic numbers which are of length n. Return the answer in any order.
A strobogrammatic number is a number that looks the same when flipped upside down.
Examples
-
Example 1:
- Input:
n = 2 - Expected Output:
["11", "69", "88", "96"] - Justification: When these numbers are rotated 180 degrees, they appear the same as their original form. Other two-digit combinations do not retain the same appearance after being flipped.
- Input:
-
Example 2:
- Input:
n = 1 - Expected Output:
["0", "1", "8"] - Justification: These are the only single-digit numbers that look the same when viewed upside down.
- Input:
-
Example 3:
- Input:
n = 3 - Expected Output:
["101", "609", "808", "906", "111", "619", "818", "916", "181", "689", "888", "986"] - Justification: These numbers are symmetrical and maintain their appearance when flipped 180 degrees. Other three-digit numbers do not meet this criterion.
- Input:
Try it yourself
Try solving this question here:
Java
Saved to Cloud
. . . .
Solution: Maximum Points You Can Obtain from Cards
Solution: Strobogrammatic Number II
Mark as Completed
On this page
Problem Statement
Examples
Try it yourself